/*
day119
2019.12.25
*/
#include<iostream>
#include<vector>
#include<cmath> 
using namespace std;


class Solution {
public:
	int index(vector<int> vec, int val)
	{
		int l = 0, r = vec.size();
		int mid;
		while (l < r)
		{
			mid = l + (r - l) / 2;
			if (vec[mid] == val)
			{
				return mid;
			}
			if (vec[mid] > val)
			{
				r = mid;
			}
			if (vec[mid] < val)
			{
				l = mid + 1;
			}
		}
		return l;
	}



	bool isok(vector<int>& houses, vector<int>& heaters,int r)
	{
		for(int i=0;i<houses.size();i++)
		{
			int index=index(heaters,houses[i]);
			if(index==0)
			{
				r=heaters[0];
				l=-1;
			}
			else if(index==)
			{
				
			}
			
			int r=heaters
		}
		
		return true;
	}
	
    int findRadius(vector<int>& houses, vector<int>& heaters) {
        int l=1,r=houses[houses.size()-1];
        int a= heaters[heaters.size()-1];
        r= r > a ? r : a;
        int mid;
        while(l<r)
        {
        	mid=l+(r-l)/2;
        	if( isok(houses,heaters,mid) && !isok(houses,heaters,mid-1))
        	{
        		return mid;
			}
			
			if( isok(houses,heaters,mid) && isok(houses,heaters,mid-1))
        	{
        		r=mid;
			}
			
			if( !isok(houses,heaters,mid) && isok(houses,heaters,mid+1))
        	{
        		return mid+1;
			}
			
			if( !isok(houses,heaters,mid) && !isok(houses,heaters,mid+1))
        	{
        		l=mid+1;
			}
		}
		return l;
    }
};



int main()
{
	Solution s;
	
	vector<int> houses={1,5};
	vector<int> heaters{10};
	int r=8;
	cout<<s.isok(houses,heaters,r)<<endl;
	return 0;
}
